package com.zhn.usermanager.controller;

import com.zhn.usermanager.service.impl.PictureUploadServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Map;

@RestController
public class PictureUploadController {
    @Resource
    private PictureUploadServiceImpl pictureUploadService;

    @PostMapping("/pictureUpload")
    public Map<String, Object> pictureUpload(MultipartFile file, HttpServletRequest request) throws SQLException, IOException, ClassNotFoundException {
        return pictureUploadService.pictureUpload(file, request);
    }
}
